<script>
	import request from '@/ulits/request.js'
	import Api from "@/ulits/Api.js"
	export default {
		onLaunch: function() {
			console.log('App Launch')
			if (uni.getStorageSync("token")) return
			uni.login({
				provider: 'weixin',
				success: async (ret) => {
					console.log('data++++++retretret', ret.code, Api.loginCode)
					const {
						data
					} = await request.sendRequest(Api.loginCode, {
						code: ret.code
					}, "POST")
					if (data.code !== 0) return
					uni.setStorageSync('token', data.data.access_token)
					console.log('data++++++', data.data.access_token)
				}
			})
		},
		onShow: function() {
		  const updateManager = uni.getUpdateManager();
		  updateManager.onCheckForUpdate(function(res) {
		    // 请求完新版本信息的回调
		  });
		
		  updateManager.onUpdateReady(function(res) {
		    uni.showModal({
		      title: '更新提示',
		      content: '新版本已经准备好，是否重启应用？',
		      showCancel: false,
		      success(res) {
		        if (res.confirm) {
		          // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
		          updateManager.applyUpdate();
		        }
		      }
		    });
		
		  });
		  updateManager.onUpdateFailed(function(res) {
		    // 新的版本下载失败
		    console.log('download error')
		    uni.showModal({
		      title: '提示',
		      content: '新版小程序下载失败\n请自行退出程序，手动卸载本程序，再运行',
		      confirmText: "知道了"
		    });
		  });
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>


<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";

	/*每个页面公共css */
	page {
		background: #F9F9F9;
		min-height: 100vh;
		color: #333;
	}
	p{
		margin: 0 !important;
		padding: 0 !important;
	}

	.allMask {
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.5);
		position: fixed;
		left: 0;
		top: 0;
		z-index: 9;
	}

	image {
		width: 100%;
		height: 100%;
	}

	.Evaluation_bottom {
		box-shadow: 0rpx 12rpx 16rpx 10rpx rgba(0, 0, 0, 0.2);
	}

	.notice-swiper {
		height: 100%;
		/* 根据需要设置公告滚动区域的高度 */
		position: absolute;
		top: 0;
		left: 140rpx;
		width: 100%;
	}

	.notice-item {
		// line-height: 50rpx;
		height: 100%;
		display: flex;
		width: 550rpx;
		align-items: center;
		/* 设置行高与高度一致，使得公告居中显示 */
		text-align: left;
		/* 文字居中显示 */
		overflow: hidden !important; //超出的文本隐藏
		text-overflow: ellipsis !important; //用省略号显示
		white-space: nowrap !important; //不换行
	}

	.ex {
		overflow: hidden !important; //超出的文本隐藏
		text-overflow: ellipsis !important; //用省略号显示
		white-space: nowrap !important; //不换行

	}

	.inviteIndexItems_btn {
		width: 750rpx;
		height: 100rpx;
		background: #9013FE;
		line-height: 100rpx;
		font-size: 30rpx;
		text-align: center;
		color: #fff;
	}

	.inviteIndexItems {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		width: 750rpx;
		height: 100rpx;
		border-bottom: 1rpx solid #eee;
		background: #fff;
		padding: 0 44rpx;
		box-sizing: border-box;

		.inviteIndexItems_left {
			color: #494949;
			font-size: 30rpx;
			width: 240rpx;
		}

		.inviteIndexItems_right {
			color: #999999;
			font-size: 28rpx;
			display: flex;
			justify-content: space-between;
			width: calc(100% - 240rpx);
		}
	}

	#tabar {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
	}

	.roomColor0 {
		color: #333 !important;

	}

	.roomColor1 {
		color: #5CAC00 !important;

	}

	.roomColor2 {
		color: #FC7500 !important;

	}

	.roomColor3 {
		color: #2E61FF !important;

	}

	.roomColor4 {
		color: #D0021B !important;

	}

	.roomColor5 {
		color: #9013FE !important;

	}
	
	.inviteUpdate_left,
	.inviteUpdate_right {
		width: 100%;
		min-height: 224rpx;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
	
		// float:left;
		image {
			width: 294rpx;
			height: 224rpx;
			background: #f5f5f5;
			margin-right: 20rpx;
			margin-bottom: 20rpx;
	
		}
	}
	
	.inviteUpdate_img {
		display: flex;
		align-items: center;
		justify-content: space-between;
	
		padding: 0 22rpx;
		box-sizing: border-box;
		margin-bottom: 10rpx;
	}
	
	.inviteUpdate_img_yu {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 0 22rpx;
		box-sizing: border-box;
		margin-bottom: 10rpx;
		color: #2D60FF;
		font-size: 28rpx;
		margin-top: 20rpx;
	}
</style>